//
//  LogDataObject.m
//  
//
//  Created by 冷悦 on 16/3/7.
//
//

#import "LogDataObject.h"
#import "CoreDataUtil.h"

@implementation LogDataObject

// Insert code here to add functionality to your managed object subclass
- (instancetype)initWithUserId:(NSInteger)userId
                  api:(NSString *)api
          andTimstamp:(long long)timestamp{
    NSManagedObjectContext *managedObjectContext = [CoreDataUtil sharedInstance].managedObjectContext;
    NSEntityDescription *description = [NSEntityDescription entityForName:@"LogDataObject"
                                                   inManagedObjectContext:[CoreDataUtil sharedInstance].managedObjectContext];
    self = [super initWithEntity:description insertIntoManagedObjectContext:managedObjectContext];
    
    if (self) {
        self.userId = [NSNumber numberWithInteger:userId];
        self.api = api;
        self.timestamp = [NSNumber numberWithLongLong:timestamp];
    }
    
    return self;
}

@end
